<?php

namespace addons\qingdongams\validate;

use think\Validate;

class Invoice extends Validate {
    /**
     * 验证规则
     */
    protected $rule = [
        'customer_id'   => 'number',
        'contract_id'   => 'number',
        'type'  => 'max:64',
        'time'  => 'date',
        'money'         => 'number',
        'check_status'  => 'number|between:0,5',
        'remark'        => 'max:250',
    ];
    /**
     * 提示消息
     */
    protected $message = [];
    /**
     * 字段描述
     */
    protected $field = [
        'customer_id'   => '客户',
        'type'  => '开票类型',
        'time'  => '开票日期',
        'money'         => '开票金额',
        'check_status'  => '审核状态',
        'remark'        => '备注',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'create' => [
            'number',
            'customer_id',
            'contract_id',
            'money',
            'time',
            'type',
            'check_status',
            'remark',
            'head_type',
            'invoice_header',
            'taxpayer_number',
            'bank_deposit',
            'bank_account',
            'invoice_address',
            'invoice_mobile',
            'contacts',
            'phone',
            'address',
            'address_detail',
        ],
        'edit'   => [],
    ];
}
